<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_group', function (Blueprint $table) {
            $table->id();
            $table->integer('parent_id')->default(0)->comment('父级Id');
            $table->string('name', 20)->default('')->comment('组织名称');
            $table->string('description', 255)->default('')->comment('组织介绍');
            $table->integer('level')->default(0)->comment('组织级别');
            $table->tinyInteger('status')->default(0)->comment('状态:1=正常,2=禁用');
            $table->tinyInteger('is_delete')->default(0)->comment('是否删除:1=删除,0=正常');
            $table->integer('created_at')->default(0)->comment('创建时间');
            $table->integer('updated_at')->default(0)->comment('修改时间');
        });
        DB::statement("ALTER TABLE `admin_group` comment '【后台】组织'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_group');
    }
};
